package demo.JUnit5;

import org.junit.platform.engine.discovery.ClassNameFilter;
import org.junit.platform.engine.discovery.DiscoverySelectors;
import org.junit.platform.launcher.Launcher;
import org.junit.platform.launcher.LauncherDiscoveryRequest;
import org.junit.platform.launcher.TestExecutionListener;
import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder;
import org.junit.platform.launcher.core.LauncherFactory;
import org.junit.platform.launcher.listeners.SummaryGeneratingListener;

public class PlatformDemo02_执行测试类 {
    public static void main(String[] args) {
        LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
                .selectors(DiscoverySelectors.selectPackage("demo.JUnit5")
                         , DiscoverySelectors.selectClass(PlatformDemo02_执行测试类.class))
                .filters(ClassNameFilter.includeClassNamePatterns(".*",
                        "demo.JUnit5.JupiterDemo04_Assumptions假设"
                      , "demo.JUnit5.JupiterDemo05_测试执行顺序"
                      ))
                .build();
        Launcher launcher = LauncherFactory.create();
        TestExecutionListener listener = new SummaryGeneratingListener();
        launcher.registerTestExecutionListeners(listener);
        launcher.execute(request);

    }

    
    
}
